**************
*SA3 to postcode  according to Australian Statistical Geography Standard 
**************

* Input: 
* OrigData\Postcode_SA3.xls

* Output:
* Data\SA3postcode.dta


clear
set more off

import excel "OrigData\Postcode_SA3.xls", sheet("Table 3") cellrange(B6:F3636) firstrow
drop if _n==1



rename RATIO ratio
rename POSTCODE postcode
rename PERCENTAGE percentage

destring postcode SA3_CODE ratio, replace

sort postcode ratio

by postcode, sort: gen test = _n
drop if test>1



save "Data\SA3postcode.dta", replace
